<?php

class index extends base {

    private $content;

    public function submenu() {
        $this->submenu = array();
        $this->submenu[0]["name"] = "Overview";
        $this->submenu[0]["callback"] = "overview";
        $this->submenu[0]["icon"] = "icons/cross.png";
        $this->submenu[0]["rights"] = 0;
        $this->submenu[0]["enabled"] = true;
        $this->_submenu($this->submenu);
    }

    public function run() {
        $this->submenu();
        $callback = $this->_run();
        if ($callback)
            $this->content = $this->$callback();
        $this->finish($this->content);
    }

    public function overview() {
        $version = file_get_contents("/proc/version");
        $version = "Linux: ".str_replace("\n", "<br>", $version)."<br><br>\n";
        $uptime = file_get_contents("/proc/uptime");
        $uptime = "Uptime: ".str_replace("\n", "<br>", $uptime)."<br><br>\n";
        $loadavg = file_get_contents("/proc/loadavg");
        $loadavg = "Load average: ".str_replace("\n", "<br>", $loadavg)."<br><br>\n";
        $cmdline = file_get_contents("/proc/cmdline");
        $cmdline = "Command line: ".str_replace("\n", "<br>", $cmdline)."<br><br>\n";
        return $version.$uptime.$loadavg.$cmdline;        
        }
        
}

?>